package javacore.classinface.inface;

/* Testing operator instanceof*/

interface X {
}

class A implements X {
}

class B extends A {
}

public class FirstInterfaceDemo {
	public static void main(String[] args) {
		A a = new A();
		B b = new B();

		if (b instanceof X)
			System.out.println("b is one instance of X");
		else
			System.out.println("b is not one instance of X");

		if (b instanceof B)
			System.out.println("b is one instance of B");
		else 
			System.out.println("b is not one instance of B");
		
		if (b instanceof A)
			System.out.println("b is one instance of A");
		else 
			System.out.println("b is not one instance of A");
		
		if (a instanceof A)
			System.out.println("a is one instance of A");
		else 
			System.out.println("a is not one instance of A");
		
		if (a instanceof X)
			System.out.println("a is one instance of X");
		else 
			System.out.println("a is not one instance of X");
	}
}
